<template>
  <div class="resume">
    <div class="text">每日推荐我是</div>
    <div id="charts"></div>
    <Button @click="postTest">点击</Button>
  </div>
</template>

<script>
import echarts from 'echarts'

let myChart = null

export default {
  data () {
    return {
      loading: false
    }
  },
  methods: {
    initChart () {
      myChart = echarts.init(document.getElementById('charts'))
      let option = {
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [{
          data: [820, 932, 901, 934, 1290, 1330, 1320],
          type: 'line',
          areaStyle: {}
        }]
      }
      myChart.setOption(option)
    },
    postTest () {
    }
  },
  async mounted () {
    this.initChart()
  }
}
</script>

<style scoped lang="less">
#charts {
  width: 60%;
  height: 500px;
  margin: 0 auto;
}

.text {
  /*display: inline-block;*/
  text-align: center;
  font-size: 28px;
  background-image: linear-gradient(to bottom, #E2EEF9, #E2EEF9, #1897E2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
</style>
